package test923;

import java.util.Scanner;

public class third
{
    public static void main(String[] args)
    {

        char q;
        char o;
        while (true)
        {
            Scanner scanner = new Scanner(System.in);
            Scanner in = new Scanner(System.in);
            System.out.println("请输入x的值");
            int a = scanner.nextInt();
            System.out.println("请输入y的值");
            int b = scanner.nextInt();
            System.out.println("请输入一个运算符");
            o = in.next().charAt(0);
            System.out.println("最终结果为：");
            switch (o) {
                case '+':
                    jiafa(a, b);
                    break;
                case '-':
                    jianfa(a, b);
                    break;
                case '*':
                    chengfa(a, b);
                    break;
                case '/':
                    chufa(a, b);
                    break;
            }
            System.out.println("是否继续运算？是y否n");
            q = in.next().charAt(0);
            if (q == 'n')
            {
                System.out.println("欢迎下次使用");
                break;
            }
        }

    }
            public static void jiafa(int x ,int y){
                System.out.println(x+"+"+y+"="+(x+y));
            }
            public static void jianfa(int x ,int y){
                System.out.println(x+"-"+y+"="+(x-y));
            }
            public static void chengfa(int x ,int y){
                System.out.println(x+"*"+y+"="+(x*y));
            }
            public static void chufa(float x ,float y){
                System.out.println(x+"/"+y+"="+(x/y));
            }



}
